package handling.channel.handler;

import client.MapleCharacter;
import client.skills.Skill;
import client.skills.SkillFactory;
import constants.SkillConstants;
import constants.skills.新手;
import server.MapleStatEffect;
import tools.AttackPair;

import java.awt.*;
import java.util.List;

public class AttackInfo {
    public int skillId;
    public int charge;
    public int lastAttackTickCount;
    public List<AttackPair> allDamage;
    public AttackSubInfo AttackSubInfo;
    public Point position;
    public Point skillposition = null;
    public int display;
    public int direction;
    public int stance;
    public int maxDamageOver = 2100000000;
    public short starSlot;
    public short cashSlot;
    public byte numDamage;
    public byte numAttacked;
    public byte numAttackedAndDamage;
    public byte speed;
    public byte AOE;
    public byte unk;
    public byte zeroUnk;
    public byte ef;
    public byte skllv;
    public List movei;
    public boolean real = true;
    public boolean move = false;
    public boolean isCloseRangeAttack = false;
    public boolean isRangedAttack = false;
    public boolean isMagicAttack = false;

    public int getSkillId() {
        return this.skillId;
    }

    public int getCharge() {
        return this.charge;
    }

    public int getLastAttackTickCount() {
        return this.lastAttackTickCount;
    }

    public List getAllDamage() {
        return this.allDamage;
    }

    public Point getPosition() {
        return this.position;
    }

    public Point getSkillposition() {
        return this.skillposition;
    }

    public int getDisplay() {
        return this.display;
    }

    public int getDirection() {
        return this.direction;
    }

    public int getStance() {
        return this.stance;
    }

    public int getMaxDamageOver() {
        return this.maxDamageOver;
    }

    public short getStarSlot() {
        return this.starSlot;
    }

    public short getCashSlot() {
        return this.cashSlot;
    }

    public byte getNumDamage() {
        return this.numDamage;
    }

    public byte getNumAttacked() {
        return this.numAttacked;
    }

    public byte getNumAttackedAndDamage() {
        return this.numAttackedAndDamage;
    }

    public byte getSpeed() {
        return this.speed;
    }

    public byte getAOE() {
        return this.AOE;
    }

    public byte getUnk() {
        return this.unk;
    }

    public byte getZeroUnk() {
        return this.zeroUnk;
    }

    public byte getEf() {
        return this.ef;
    }

    public byte getSkllv() {
        return this.skllv;
    }

    public List getMovei() {
        return this.movei;
    }

    public boolean isReal() {
        return this.real;
    }

    public boolean isMove() {
        return this.move;
    }

    public boolean isCloseRangeAttack() {
        return this.isCloseRangeAttack;
    }

    public boolean isRangedAttack() {
        return this.isRangedAttack;
    }

    public boolean isMagicAttack() {
        return this.isMagicAttack;
    }

    public MapleStatEffect getAttackEffect(MapleCharacter chr, int skillLevel, Skill theSkill) {
        if (SkillConstants.isMulungSkill(skillId) || SkillConstants.isPyramidSkill(skillId) || SkillConstants.isInflationSkill(skillId) || skillId == 新手.升级特效 || SkillConstants.is品克缤技能(skillId)) {
            skillLevel = 1;
        } else if (skillLevel <= 0) {
            return null;
        }
        if (SkillConstants.isLinkedAttackSkill(skillId)) {
            Skill skillLink = SkillFactory.getSkill(skillId);
            return skillLink.getEffect(skillLevel);
        }
        return theSkill.getEffect(skillLevel);
    }
}
